﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using Player;
using SangsTools;
using Battle;
using ILRuntime;
public class DebugGUI:MonoBehaviour
{
    int guiIndex = 0;
    Rect GetRect()
    {
        return new Rect(Screen.width - 100, guiIndex++ * 75, 100, 50);
    }

    private void OnGUI()
    {
        guiIndex = 1;

        if (GUI.Button(GetRect(), "NextLevel"))
        {
            Battle.LevelScriptMgr.NextLevel();
        }
        if (GUI.Button(GetRect(), "Add Item"))
        {
            foreach (var item in Item.ItemDataMgr.Ins.AllItemData)
            {
                MyPlayer.Ins.MyBackpack.GetItem(item.strItemTag, 100);
            }
        }
        if (GUI.Button(GetRect(), "Add Science"))
        {
            MyPlayer.Ins.MyScience.ScienceNum += 10;
        }
        if (GUI.Button(GetRect(), "Add Gold"))
        {
            MyPlayer.Ins.MyBackpack.Gold += 100;
        }

        if (GUI.Button(GetRect(), "Add Dot Buff"))
        {
            var buffData = new ST_ObjBuffData()
            {
                strBuffName="Dot",
                nNum=5,
                fBuffLife=1,
                fBornTime=Time.time,
            };
            foreach (var item in EnemyMgr.Ins.AllEnemy)
            {
                string guid = item.AddBuff(buffData);
            }
        }

        if (GUI.Button(GetRect(), "HotFixVersion"))
        {
            Debug.Log(ILRuntimeTools.HotFixVersion);
        }
    }
}
